﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:System="clr-namespace:System;assembly=mscorlib">

	<ResourceDictionary.MergedDictionaries>
		<ResourceDictionary Source="..\Shared.xaml" />
	</ResourceDictionary.MergedDictionaries>

	<Style x:Key="ToggleButton.WithEffect" TargetType="{x:Type ToggleButton}">
		<Style.BasedOn>
			<Style TargetType="ToggleButton">
				<Setter Property="VerticalAlignment" Value="Center"/>
				<Setter Property="HorizontalAlignment" Value="Center"/>
				<Setter Property="MinWidth" Value="0"/>
				<Setter Property="Foreground" Value="{DynamicResource VOColor02}"/>
				<Setter Property="FontFamily" Value="Arial"/>
				<Setter Property="FontSize" Value="11"/>
				<Setter Property="FocusVisualStyle" Value="{x:Null}" />
				<Setter Property="Control.Template">
					<Setter.Value>
						<ControlTemplate TargetType="ToggleButton">

							<Grid>
								<Border Name="background" CornerRadius="1" Background="Transparent"/>
								<Border Name="highlight" CornerRadius="1" Background="{DynamicResource VOColor12}" Opacity="0"/>
								<ContentPresenter Margin="1" VerticalAlignment="Center" ContentTemplate="{TemplateBinding ContentControl.ContentTemplate}" Content="{TemplateBinding ContentControl.Content}" />
							</Grid>

							<ControlTemplate.Triggers>
								<Trigger Property="IsChecked" Value="True">
									<Setter Property="Background" TargetName="background" Value="{DynamicResource VOColor14}" />
									<Setter Property="Foreground" Value="White" />
								</Trigger>
								<EventTrigger RoutedEvent="Mouse.MouseEnter">
									<BeginStoryboard>
										<Storyboard>
											<Storyboard.Children>
												<DoubleAnimation To="0.7" Duration="00:00:00.2000000" Storyboard.TargetName="highlight" Storyboard.TargetProperty="Opacity" />
											</Storyboard.Children>
										</Storyboard>
									</BeginStoryboard>
								</EventTrigger>
								<EventTrigger RoutedEvent="Mouse.MouseLeave">
									<BeginStoryboard>
										<Storyboard>
											<Storyboard.Children>
												<DoubleAnimation To="0" Duration="00:00:00.2000000" Storyboard.TargetName="highlight" Storyboard.TargetProperty="Opacity" />
											</Storyboard.Children>
										</Storyboard>
									</BeginStoryboard>
								</EventTrigger>
							</ControlTemplate.Triggers>
						</ControlTemplate>
					</Setter.Value>
				</Setter>
			</Style>
		</Style.BasedOn>
	</Style>
</ResourceDictionary>